home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / doc / other / lockdev.doc < prev    next >
Encoding:
Text File  |  1992-09-11  |  3.9 KB  |  116 lines

  1.  
  2.  
  3.         Instructions for installing the INGRES lock device in UNIX
  4.  
  5.                                May 19, 1983
  6.  
  7.  
  8.  
  9.      INGRES version 8.1 has a fully  implemented  concurrency  control
  10.      mechanism.  The INGRES system sets and clears locks by writing to
  11.      a server named "ingreslock".  If the socket cannot be opened  for
  12.      writing, INGRES runs without any concurrency control.
  13.  
  14.      Initially it is advisable to bring up  INGRES  without  the  con-
  15.      currency  device.  If planned usage of the INGRES system requires
  16.      concurrency control then the  server  "ingreslock"  must  be  in-
  17.      stalled into your UNIX system.
  18.  
  19.      This document describes the procedure  for  installing  the  UNIX
  20.      server for "ingreslock".
  21.  
  22.  
  23.      1.  Log in as root.
  24.  
  25.      2.  Compiling the concurrency device
  26.  
  27.  
  28.          2.1.  change directory to ../source/support
  29.  
  30.              The  concurrency  device   consists   of   three   files:
  31.              .../source/support/ildr.c
  32.               .../source/h/ildr.h and .../source/support/init_socket.c
  33.  
  34.              compile the lock driver
  35.                      make ingreslock
  36.  
  37.  
  38.          2.2.  Installation Parameters
  39.  
  40.              There are several parameters in ildr.h that can be set by
  41.              the user.  These include:
  42.  
  43.                      NLOCKS - number of locks
  44.                      PLOCKS - page locks
  45.                      RLOCKS - relation locks
  46.                      DLOCKS - data base locks
  47.  
  48.              NLOCKS is the maximum number of  locks  permissible.   It
  49.              determines  the  size  of  the lock table.  PLOCKS is the
  50.              maximum number of page, relation  and  data  base  locks.
  51.              RLOCKS  is  the  maximum number of relation and data base
  52.              locks.  DLOCKS is the maximum number of data base  locks.
  53.              Only DLOCKS INGRESes can be active at one time.
  54.  
  55.              The following conditions must  hold  to  protect  against
  56.              deadlock due to lock table overflow:
  57.  
  58.                      NLOCKS > PLOCKS > RLOCKS > DLOCKS + 6
  59.  
  60.              The extra number of RLOCKS are  required  inorder  to  be
  61.              able  to run 6-variable queries.  We recommend first set-
  62.              ting DLOCKS and then setting the other parameters as fol-
  63.              lows:
  64.  
  65.                      RLOCKS = 2*DLOCKS + 6
  66.                      PLOCKS = RLOCKS + 3
  67.                      NLOCKS = PLOCKS + 1
  68.  
  69.              For example, to reduce the size of the  lock  table,  one
  70.              could  set DLOCKS = 2, RLOCKS = 10, PLOCKS = 13, NLOCKS =
  71.              14.  In this case, only 2 people could be running  ingres
  72.              at one time.
  73.  
  74.              As  another  example,  to  allow  for   more   concurrent
  75.              INGRESes,  one could set DLOCKS = 20, RLOCKS = 46, PLOCKS
  76.              = 49, NLOCKS = 50.  This scenario would allow for  twenty
  77.              simultaneous INGRES users.
  78.  
  79.  
  80.          2.3.  Copy the server
  81.  
  82.              Copy the lock server to where the  servers  are  kept  on
  83.              your system.
  84.  
  85.                      cp ingreslock  /etc/ingreslock
  86.  
  87.  
  88.      3.  Add the service to /etc/services
  89.  
  90.          You should have an entry
  91.  
  92.  
  93.                  ingreslock      1524/tcp                # Ingres concurrency driver
  94.  
  95.  
  96.  
  97.          In your /etc/services file. Note that  the  number  (in  this
  98.          case  1524)  need only be unique among your servers, and does
  99.          NOT have to be 1524 (we use it though).
  100.  
  101.      4.  Put lock server in /etc/rc.local thusly:
  102.  
  103.                  /etc/ingreslock & echo -n ' ingreslock' > /dev/console
  104.  
  105.  
  106.          This ensures that the lock server is always running when  the
  107.          system is up.
  108.  
  109.      5.  Done.
  110.  
  111.          INGRES will now use the "ingreslock"  service  for  its  con-
  112.          currency control.  A simple way to verify this is to try run-
  113.          ning (for example) "purge" on a data  base  while  anyone  is
  114.          running "ingres" on the same data base.
  115.  
  116.